package com.hnyyjsxy.service.impl;

import com.hnyyjsxy.dao.SuperAdmainDao;
import com.hnyyjsxy.dao.impl.SuperAdmainDaoImpl;
import com.hnyyjsxy.domain.Teacher;
import com.hnyyjsxy.service.SuperAdmainService;

import java.util.ArrayList;
import java.util.List;

/**
 * @date 2021/02/07
 */
public class SuperAdmainServiceImpl implements SuperAdmainService {
    SuperAdmainDao superAdmainDao = new SuperAdmainDaoImpl();

    /**
     * 添加宿管老师
     * @param teacher
     * @param password
     */
    @Override
    public void addTeacher(Teacher teacher, String password) {
        //调用持久化层方法
        superAdmainDao.addTeacher(teacher);
        superAdmainDao.addTeacherAccount(teacher.getAccount(),password);
    }

    /**
     * 查询所有宿管老师信息
     * @return
     */
    @Override
    public List<Teacher> queryAllTeacher() {
        return superAdmainDao.queryAllTeacher();
    }

    /**
     * 根据账号删除某个宿管老师信息
     * @param account 宿管老师账号
     */
    @Override
    public void delTeacherByAccount(String account) {
        superAdmainDao.delTeacherByAccount(account);
    }
}
